FROM php:7.4-fpm
# https://hub.docker.com/_/php

#docker-php-source extract \
#	# do important things \
#	&& docker-php-source delete

RUN sed -i "s@http://deb.debian.org@http://mirrors.aliyun.com@g" /etc/apt/sources.list \
  && cat /etc/apt/sources.list \
  && rm -Rf /var/lib/apt/lists/* \
  && apt-get update -y \
  && apt-get -y install libxml2-dev\
  && docker-php-ext-install mysqli \
  && docker-php-ext-install pdo_mysql \
  && docker-php-ext-install bcmath \
  && docker-php-ext-configure opcache --enable-opcache \
  && docker-php-ext-install opcache \
  && apt-get install -y --no-install-recommends libfreetype6-dev libjpeg62-turbo-dev libpng-dev libxml2-dev \
  && docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \
  && docker-php-ext-install -j$(nproc) gd

# PECL扩展
RUN pecl install redis-5.3.7 \
	&& docker-php-ext-enable redis

ADD php.ini "$PHP_INI_DIR/php.ini"
ADD www.conf "/usr/local/etc/php-fpm.d/www.conf"

EXPOSE 9000